<!-- 营运绩效>千包能耗 数据项列表 -->
<template>
  <div class="detail">
    <div :class="['item', backgroundColor === 'green' ? 'green-bg' : 'blue-bg']" v-for="item in list" :key="item.label">
      <div class="label">{{ item.label }}</div>
      <div class="num">
        <span>{{ item.value }}</span>
        <span class="unit" v-if="item.unit">{{ item.unit }}</span>
        <sup v-if="item.sup">{{ item.sup }}</sup>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "DataList",
  props: {
    list: {
      type: Array,
      default: () => [],
    },
    backgroundColor: {
      type: String,
      default: "blue-bg",
    },
  },
  data() {
    return {};
  },
};
</script>
<style scoped lang="scss">
.item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  height: 44px;
  background-size: cover;
  background-repeat: no-repeat;
  .label {
    padding-left: 18px;
    min-width: 120px;
    font-size: 14px;
    color: #B9BCC1;
  }
  .unit {
    margin-left: 4px;
    font-size: 12px;
    font-family: Microsoft YaHei;
    color: #B9BCC1;
    word-break: keep-all;
  }
  .num {
    display: flex;
    align-items: center;
    padding-right: 20px;
    span:nth-child(1) {
      font-size: 18px;
      font-weight: bold;
      color: #BDE1FF;
    }
  }
}
.blue-bg {
  background-image: url("~@/assets/images/cylxt_icon_dk.png");
}
.green-bg {
  background-image: url("~@/assets/images/zhcc_icon_shldk.png");
}
.mb-20 {
  margin-bottom: 20px;
}
.mb-10 {
  margin-bottom: 10px;
}
</style>
